/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.hazardsource.mapper;

import com.koron.hazardsource.domain.IndicationItems;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface IndicationItemsMapper {
    /**
     * 新增指标项
     * @param bean
     * @return
     */
    Integer insert(@Param("bean") IndicationItems bean);

    /**
     * 修改指标项
     * @param bean
     * @return
     */
    Integer update(@Param("bean") IndicationItems bean);

    /**
     *批量删除指标项
     * @param idList
     * @return
     */
    Integer batchDetele(@Param("idList") List<String> idList);

    /**
     * 根据主键查询指标项详情
     * @param id
     * @return
     */
    IndicationItems queryOne(@Param("id") String id);

    /**
     * 根据指标类型查询指标项
     * @param typeKey
     * @return
     */
    List<IndicationItems> queryByKey(@Param("typeKey") String typeKey);

    /**
     * 根据指定条件查询所有数据
     * @param typeKey
     * @param name
     * @param start
     * @param rows
     * @return
     */
    List<IndicationItems> queryAll(@Param("typeKey") String typeKey,@Param("name") String name,@Param("start") Integer start,@Param("rows") Integer rows);

    /**
     * 根据指定条件统计指标项
     * @param typeKey
     * @param name
     * @return
     */
    Integer countAll(@Param("typeKey") String typeKey,@Param("name") String name);

    /**
     * 判断同一指标类型下是否存在相同的指标项（已除去本身）
     * @param id
     * @param name
     * @param typeKey
     * @return
     */
    Integer isExistByNameAndTypeKey(@Param("id") String id,@Param("name") String name,@Param("typeKey") String typeKey);

    /**
     * 批量修改指标项
     * @param itemList
     * @return
     */
    Integer batchUpdate(@Param("itemList") List<IndicationItems> itemList);

    /**
     * 根据指标类型名称和指标项名称查询指标项
     * @param typeName
     * @param name
     * @return
     */
    IndicationItems matchIndicationItems(@Param("typeName") String typeName,@Param("name") String name);
}
